#include <iostream>
using namespace std;
#include <vector>

int pickdp(int x , int y , int z , vector<vector<vector<int>>>& dp);

int process(int x , int y , int rest , int a , int b)
{
  if (x < 0 || x > 9 || y < 0 || y > 8)
  {
    return 0;
  }

  if (rest == 0)
  {
    return (x == a && y ==b) ? 1 : 0;
  }

  int ways = process(x-2 , y+1 , rest-1 , a , b);
  ways += process(x-1 , y+2 , rest-1 , a , b);
  ways += process(x+1 , y+2 , rest-1 , a , b);
  ways += process(x+2 , y+1 , rest-1 , a , b);
  ways += process(x-2 , y-1 , rest-1 , a, b);
  ways += process(x-1 , y-2 , rest-1 , a , b);
  ways += process(x+1 , y-2 , rest-1 , a, b);
  ways += process(x+2 , y-1 , rest-1 , a ,b);


  return ways;
}
int process1(int k , int a , int b , vector<vector<vector<int>>>& dp)
{
  dp[a][b][0] = 1;

  for (int z = 1; z <= k; z++)
  {
    for (int x = 0; x < 10; x++)
    {
      for (int y = 0; y < 9; y++)
      {
        int ways = pickdp(x-2 , y+1 , z-1, dp);
        ways += pickdp(x-1 , y+2 , z-1 , dp);
        ways += pickdp(x+1 , y+2 , z-1 , dp);
        ways += pickdp(x+2 , y+1 , z-1 , dp);
        ways += pickdp(x-2 , y-1 , z-1 , dp);
        ways += pickdp(x-1 , y-2 , z-1 , dp);
        ways += pickdp(x+1 , y-2 , z-1 , dp);
        ways += pickdp(x+2 , y-1 , z-1 , dp);

        dp[x][y][z] = ways;
      }
    }
  }

  return dp[0][0][k];
}


int pickdp(int x , int y , int z , vector<vector<vector<int>>>& dp)
{
  if (x < 0 || x > 9 || y < 0 || y > 8 )
  {
      return 0;
  }

  return dp[x][y][z];
}



int main()
{

  vector<vector<vector<int>>> dp(10 , vector<vector<int>>(9 , vector<int>(8 , 0)));

  cout << process1(7 , 7 ,7 , dp) << endl;


  return 0;
}
